<div class="page-header">
	<div class="page-title"><h3><?php echo Yii::t('app', 'Point setting') ?></h3></div>
	<div class="buttons">
		<button class="btn btn-primary" id="btn_save"><?php echo Yii::t('app', 'Save')?></button>
	</div>
</div>

<?php $form = $this->beginWidget('CActiveForm', array(
	'id'=>'edit-form',
	'method'=>'post',
	'enableClientValidation'=>true,
)); ?>
<div class="grid-view">
<table class="table table-bordered table-hover">
	<thead>
	<tr>
		<th rowspan="2"><?php echo Yii::t('app', 'Content') ?></th>
		<th colspan="2"><?php echo Yii::t('app', 'Point setting') ?></th>
		<th rowspan="2"><?php echo Yii::t('app', 'From') ?></th>
		<th rowspan="2"><?php echo Yii::t('app', 'To') ?></th>
	</tr>
	<tr>
		<th><?php echo Yii::t('app', 'Male') ?></th>
		<th><?php echo Yii::t('app', 'Female') ?></th>
	</tr>
	</thead>
	<tbody>
	<?php $i=1; foreach($items as $item): ?>
		<?php $class = $i % 2 == 0 ? 'even' : 'odd'; ?>
		<?php $key = $item->id; ?>
		<tr class="<?php echo $class ?>">
			<td>
				<?php echo $form->textField($item, 'title', array('name'=>"PointFee[$key][title]", 'class'=>'span12')); ?>
				<?php echo $form->error($item, 'title'); ?>
			</td>
			<td>
				<?php echo $form->textField($item, 'male_point', array('name'=>"PointFee[$key][male_point]", 'class'=>'span12')); ?>
				<?php echo $form->error($item, 'male_point'); ?>
			</td>
			<td>
				<?php echo $form->textField($item, 'female_point', array('name'=>"PointFee[$key][female_point]", 'class'=>'span12')); ?>
				<?php echo $form->error($item, 'female_point'); ?>
			</td>
			<td>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => $item,
					'attribute'=>'effect_from',
					'language'=>Yii::app()->language,
					'options'=>array(
						'dateFormat'=>'yy-mm-dd',
						'changeMonth'=> true, 
						'changeYear'=> true,
					),
					'htmlOptions'=>array('name'=>"PointFee[$key][effect_from]"),
				));
				?>
			</td>
			<td>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => $item,
					'attribute'=>'effect_to',
					'language'=>Yii::app()->language,
					'options'=>array(
						'dateFormat'=>'yy-mm-dd',
						'changeMonth'=> true, 
						'changeYear'=> true,
					),
					'htmlOptions'=>array('name'=>"PointFee[$key][effect_to]"),
				));
				?>
			</td>
		</tr>
	<?php $i++; endforeach; ?>
	</tbody>
</table>
</div><!--//gridview -->
<?php $this->endWidget(); ?>

<style>
th { text-align: center !important; vertical-align: middle !important;}
</style>